package reflect;

/**
 * @author Administrator
 * @Description
 * @date 2022/5/23 10:35
 **/
public class ReflectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        Class cls = Class.forName("reflect.Person");
        //该方法会调用class所表示的类的(无参构造器)实例化对象
        Object o = cls.newInstance();
        System.out.println(o);
    }
}
